function mass_center = liquid_mass_center(liquid_volume, bottle_shape, mode_parameters)

switch mode_parameters.mode_name
    case 'monte_carlo'
        volume_function = @(liquid_level) monte_carlo_estimation(bottle_shape, liquid_level, mode_parameters, 'volume') - liquid_volume;
        start_level = 10;
        actual_liquid_level = fzero(volume_function, start_level);
        mass_center = monte_carlo_estimation(bottle_shape, actual_liquid_level, mode_parameters, 'mass_center');
    case 'mesh'
        rot_matr = rotation_matrix(mode_parameters.rotation_angle);
        mode_parameters.rotated_vertices = (rot_matr * mode_parameters.vertices')'; 
        volume_function = @(liquid_level) mesh_estimation(liquid_level, mode_parameters, 'volume') - liquid_volume;
        %start_level = find_rough_liquid_level(mode_parameters,liquid_volume, liquid_volume / 10);
        start_level = (max(bottle_shape(2, :)) + min(bottle_shape(2, :)))/2;
        actual_liquid_level = fzero(volume_function, start_level);
        mass_center = mesh_estimation(actual_liquid_level, mode_parameters, 'mass_center');
    otherwise
        error('Invalide mode!');
end

%disp(num2str(actual_liquid_level));

end
